<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<link href="${ctx}/css/main/base.css" rel="stylesheet" type="text/css"/>
<link href="${ctx}/css/main/main.css" rel="stylesheet" type="text/css"/>
<script src="${ctx}/scripts/commons/util.js"></script>
<body class="m_6" onload="errInfo();">
<div id="main">
<form name="form1" method="post">
<input type="hidden" name="info" id="info" value="${info}"/>
	<div><div id="err"></div></div>
	<div class="b_add font14 bg3 zc_bt">设置禁用资源</div>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab_1">
	  <tr>
	  <input type="hidden" name="role" id="role" value="${baseRole.roleId}"/>
		<td width="80" align="center"><input type="checkbox" name="chkbx_all"  onclick="checkAll('form1',this)"/></td>
		<td width="80" align="center">序号</td>
	    <td width="300" align="center">菜单名称——资源名称</td>
	    <td align="center">URL</td>
	  </tr>
	  <s:iterator value="list" status="o" id="obj">
	  <tr>
	    <td  width="80" align="center"><input type="checkbox" name="asset" id="asset" value="${obj[1].assetId}" <s:if test="#obj[1].assetId in asset">checked</s:if> /></td>
	    <td  width="80" align="center"><s:property value="#o.index+1"/></td>
        <td width="300" align="center">${obj[0]}——${obj[1].assetName}</td>
        <td>${obj[1].assetLink}</td>
	  </tr>
	  </s:iterator>
	</table>
</div>
<div align="center"><input  type="button" onclick="managerAsset();" value="确定" class="log_f2">
</form>
</body>
</html>
<script type="text/javascript">
<!--

function managerAsset(){

var role = document.getElementById("role").value;

if(role == null || role == ''){
document.getElementById("err").innerHTML ="<font color='red'>请选择角色!</div>";
}else{

	document.forms[0].action="${ctx}/asset/asset!setAssetIdGroup.action";
	document.forms[0].submit();
	}
}

function preCreateUser(){
window.location = "${ctx}/user/user!preCreateUser.action?user.userFlag=0&user.deptId=<s:property value='department.deptId'/>";

}

function MM_list(){
document.forms[0].submit();

}

function clearPsw(id){
document.forms[0].action ="${ctx}/user/user_clearPsw.action";
document.getElementById("user.userId").value = id;
document.forms[0].submit();
}

	function errInfo(){
	
		var info = document.getElementById("info").value;
		
		if(info == 'asset_1'){
		   document.getElementById("err").innerHTML ="<font color='red'>成功!</div>";
		   
		}else if(info == 'asset_6'){
			document.getElementById("err").innerHTML ="<font color='red'>请选择角色!</div>";
		}else if(info == 'asset_7'){
			document.getElementById("err").innerHTML ="<font color='red'>请选择禁用资源!</div>";
		}
	}
//-->
</script>
